package com.example.demo.config.property;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

@Data
@Component
@Validated
@ConfigurationProperties(prefix = "async")
public class AsyncProperties {

    private TaskExecutorConifg taskExecutor = new TaskExecutorConifg();
    private SchedulerTaskExecutorConifg schedulerTaskExecutor = new SchedulerTaskExecutorConifg();

    @Data
    public static class TaskExecutorConifg {
        private Integer corePoolSize = 5;
        private Integer maxPoolSize = 10;
        private Integer queueCapacity = 1000;
    }

    @Data
    public static class SchedulerTaskExecutorConifg {
        private Integer poolSize = 3;
    }
}
